package com.optimize02.faactory;

import com.optimize02.service.Strategy;

import java.util.HashMap;
import java.util.HashSet;

/**
 * @author GuoJH
 * @date 2022/8/11 10:36
 * @remark
 */
public class StrategyFactory {

    private HashMap<String, Strategy> strategies = new HashMap<>();

    public void put(String key, Strategy sy) {
        strategies.put(key, sy);
    }

    public Strategy get(String key) {
        return strategies.get(key);
    }

    public void strategyMethod(String key) {
        strategies.get(key).strategyMethod();
    }
}
